package golang

import (
	"fmt"
	"testing"
)

func TestSort(t *testing.T) {
	arr := [...]int{1, 4, 2, 5, 3}
	for i := 0; i < len(arr); i++ {
		for j := 0; j < len(arr)-(i+1); j++ {
			if arr[j] > arr[j+1] { //交换
				b := arr[j]
				arr[j] = arr[j+1]
				arr[j+1] = b
			}
		}
	}
	fmt.Println(arr)
}
